#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int finddao(int shu,int a)
{
	int j = 1;
	while (! (j & shu))
	{
		shu=shu >> 1;
		a++;
	}
	return a;
}
int findnum(int arr[], int n, int* pnum1, int* pnum2)
{
	int sum = 0;
	for (int i = 0; i < n; i++)
	{
		sum = sum ^ arr[i];
	}
	return sum;
}
void suan(int qsz, int asz, int qwe[],int  asd[])
{
	int j = 0;
	int i = 0;
	int sum1 = 0;
	int sum2 = 0;
	for (int i = 0; i < qsz; i++)
	{
		sum1 = sum1 ^ qwe[i];
	}

	for (int j = 0; j < asz; j++)
	{
		sum2 = sum2 ^ asd[j];
	}
	printf("%d\n", sum1);
	printf("%d\n",sum2);
}
void doxt(int arr[],int n, int a)
{
	int q = 1;
	int i = 0;
	int k = 0;
	int qs = 0;
	int as = 0;
	int qwe[] = { 0 };
	int asd[] = { 0 };
	for (a; a >0; a--)
	{
		k=q << 1;
	}
	for (i; i < n; i++)
	{
		int f=arr[i] & k;
		if (f == k)
		{
			qwe[qs] = arr[i];
			qs++;
		}
		else
		{
			asd[as] = arr[i];
			as++;
		}
	}
	int qsz= sizeof qwe/ sizeof qwe[0];
	int asz = sizeof asd / sizeof asd[0];
	suan(qsz, asz, qwe, asd);
}
int main()
{
	int arr[] = { 1,2,3,4,5,1,2,3,4,6 };
	int sz = sizeof arr / sizeof arr[0];
	int x, y;
	int sum=findnum(arr, sz, &x, &y);
	int a = 1;
	a=finddao(sum,a);
	doxt(arr,sz, a);
	return 0;
}